/*
 * RequestDataSetGuidance.java
 *
 * Created on September 9, 2002, 8:37 AM
 *
 * Copyright (c) 2002 The General Electric Company
 */

package com.ge.healthcare.autosc.processor.shemjob.guidance.dataset;


/**
 * Guidance information for ShemJob request data sets.
 * 
 * @author Daniel S. Horwitz, Compuware Corp.
 * 
 * @version AutoSC P5P6
 */
public class RequestDataSet {
	/**
	 * Pass number in which the data set is to be processed.
	 */
	private int passNumber = 0;

	/**
	 * Fully-qualified name of the class used for reading the data set.
	 */
	private String readingClassName = null;

	/**
	 * Create a request data set guidance instance.
	 * 
	 * @param passName
	 *            The name of the pass in which the data set is to be processed.
	 *            This should either be "first" or "second". Because this is
	 *            checked by the schema, anything other than "first" is assumed
	 *            to be "second".
	 * 
	 * @param readingName
	 *            Name of the class used for reading the data set.
	 */
	public RequestDataSet(String passName, String readingName) {
		if (passName.equals("first")) {
			passNumber = 1;
		} else {
			passNumber = 2;
		}
		readingClassName = readingName;
	}

	/**
	 * Get the pass number in which the data set is to be processed.
	 * 
	 * @return The pass number in which the data set is to be processed.
	 */
	public int getPassNumber() {
		return passNumber;
	}

	/**
	 * Determine if this pass is its current pass
	 * 
	 * @param currentPass
	 * @return
	 */
	public boolean isCurrentPass(int currentPass) {
		return (passNumber == currentPass);
	}

	/**
	 * Get the name of the class used for reading the data set.
	 * 
	 * @return The fully-qualified name of the class used for reading the data
	 *         set.
	 */
	public String getReadingClassName() {
		return readingClassName;
	}

	/**
	 * Return a string representation of the object.
	 * 
	 * @return A string representation of the object.
	 */
	public String toString() {
		return "{" + passNumber + "," + readingClassName + "}";
	}
}
